package com.whminwei.edu.api.student.client;

import com.whminwei.common.feign.decoder.FullHttpRspnConfig;
import com.whminwei.common.http.rspn.BaseHttpResponse;
import com.whminwei.common.http.rspn.FullHttpResponse;
import com.whminwei.edu.api.student.dto.feq.*;
import com.whminwei.edu.api.student.dto.fspn.StuSimpleInfoListFspn;
import com.whminwei.edu.api.student.dto.fspn.StudentAccountFspn;
import com.whminwei.edu.api.student.dto.fspn.StudentAllListFspn;
import com.whminwei.edu.api.student.dto.fspn.StudentListFspn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author wangy
 * @since 2024/5/17
 */
@FeignClient(name = "xzzg-pt-student-service", contextId = "student-info", configuration = FullHttpRspnConfig.class)
public interface StudentClient {

    /**
     * 通过账号获取学生信息
     * sso使用此接口获取学生信息
     * @author wangy
     * @since 16:28 2024/8/6
     * @param req
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.student.dto.fspn.StudentAccountFspn>
     **/
    @PostMapping("/student/getStudentByAccount")
    FullHttpResponse<StudentAccountFspn> getStudentByAccount(@RequestBody @Validated StudentAccountFeq req);

    /**
     * 推送学生信息
     *
     * @param req
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.student.dto.fspn.StudentFspn>
     * @author wangy
     * @since 17:27 2024/5/17
     **/
    @PostMapping("/student/pushStudent")
    BaseHttpResponse pushStudent(@RequestBody @Validated StudentFeq req);


    /**
     * 推送学生注册信息
     *
     * @param req
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.student.dto.fspn.StudentListFspn>
     * @author wangy
     * @since 17:27 2024/5/17
     **/
    @PostMapping("/student/exitStudents")
    FullHttpResponse<StudentListFspn> exitStudents(@RequestBody @Validated RegisterResultFeq req);


    /**
     * 检查学生idNumber是否已在在校学生中
     *
     * @author wangy
     * @since 10:29 2024/5/21
     * @param req
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.student.dto.fspn.StudentListFspn>
     **/
    @PostMapping("/student/checkStudents")
    FullHttpResponse<StudentListFspn> checkStudents(@RequestBody @Validated StudentListFeq req);

    /**
     * 查询所有在籍在校的学生
     *
     * @return FullHttpResponse<StudentAllListFspn>
     * @author zhangzf
     * @since 2024/7/17
     */
    @PostMapping("/classe/getStudentList")
    FullHttpResponse<StudentAllListFspn> getStudentList();

    @PostMapping("/student/getStuByNameOrIdNumber")
    FullHttpResponse<StuSimpleInfoListFspn> getStuByNameOrIdNumber(@RequestBody StuSimpleInfoListFeq req);

}
